# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgname=paris-traceroute
pkgver=0.93
pkgrel=1
pkgdesc="advanced traceroute utility"
url="https://github.com/libparistraceroute/libparistraceroute"
arch="all"
license="GPL-3.0-only"
makedepends="autoconf automake libtool"
subpackages="$pkgname-dev $pkgname-doc $pkgname-ping $pkgname-dbg"
source="https://github.com/libparistraceroute/libparistraceroute/archive/v$pkgver/libparistraceroute-$pkgver.tar.gz
	in6-union.patch
	fix-idn.patch
	clean-errno.patch
	mismatched-bound.patch
	"
builddir="$srcdir/libparistraceroute-$pkgver"

prepare() {
	default_prepare
	sh autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

package() {
	make install DESTDIR="$pkgdir"
}

ping() {
	pkgdesc="paris-traceroute ping utility"

	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/ping "$subpkgdir"/usr/bin
}

sha512sums="
505de465454c349adea936637a097bb3f812f010665825badfc97751e9219325d04d8af78ac6d107e66ff6ef02a8cda1559b8073906d36a745115cd54104a8b4  libparistraceroute-0.93.tar.gz
64e48afad3ac389a13f96838f1de7a9174040cefde2843734daa33ad846340408e58a3792573422d3847718053ec9de62420f853caaf866eef0a4f3f26986e11  in6-union.patch
37e1b50e323907695df55629f7457754f788edb2de180058b909d930b355e0647e363c9650cc182678616fc2001cafe7982803b0884e299232d8331cad537675  fix-idn.patch
9b7ab98db5f8c4260d0879f59277066fe4d4beee91cb1627653447672111c64ab8a47d608492cc22b5884965ba14614bc69785df885202240a3aebd6a5663fec  clean-errno.patch
6d6ce8208c5dc8cecc9e9ef4e59a30918d6befd70108e21e194cbe4dbfd74e8ede33f4e519df1ff29a3a980a15fa99c629f3cc4bfd12363fde8bea138c2c01c5  mismatched-bound.patch
"
